Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • The Merge should be working but it doesn`t ?


    Hello Stata Team,

    is something happening that i dont know about ?
    Down here you see my dataset i build. I merged my the originrestrictivness and several other restrictiveness variables with the country and year variable already with this command : merge m:1 country year using "\\fs01\mkranz$\Dokumente\TypeofRestrictions\origi nrestrictivness.dta" ( worked fine )

    Now im trying to merge the same data but for my partnercountry variable (because i want to control FDI flows in both directions )with the same command:

    . merge m:1 partnercountry year using "\\fs01\mkranz$\Dokumente\TypeofRestrictions\partn er_equityrestrictions.dta"
    variable partnercountry not found

    i always get this error even tho the variable partnercountry is in my Dataset and written correctly. Any idea why this is happening ?



    [CODE]
    * Example generated by -dataex-. For more info, type help dataex
    clear
    input str49 country str62 partnercountry str4 year float originrestrictiveness
    "United States" "Albania" "2017" .11986046
    "Sweden" "Albania" "2017" .08006977
    "Czech Republic" "Albania" "2017" .013023255
    "Germany" "Albania" "2017" .02988372
    "Colombia" "Albania" "2017" .03672093
    "Iceland" "Albania" "2017" .17386046
    "Denmark" "Albania" "2017" .05953488
    "Austria" "Albania" "2017" .1540465
    "Türkiye" "Albania" "2017" .0824186
    "Slovenia" "Albania" "2017" .014860465
    "Japan" "Albania" "2017" .07409302
    "United Kingdom" "Albania" "2017" .042
    "Norway" "Albania" "2017" .1124186
    "Greece" "Albania" "2017" .04106977
    "Ireland" "Albania" "2017" .036906976
    "Slovak Republic" "Albania" "2017" .033813953
    "Estonia" "Albania" "2017" .02234884
    "Finland" "Albania" "2017" .027534883
    "Netherlands" "Albania" "2017" .01560465
    "France" "Albania" "2017" .04776744
    "New Zealand" "Albania" "2017" .23176745
    "Australia" "Albania" "2017" .16276744
    "Belgium" "Albania" "2017" .06044186
    "Chile" "Albania" "2017" .07467442
    "Switzerland" "Albania" "2017" .1125814
    "Hungary" "Albania" "2017" .028465116
    "Poland" "Albania" "2017" .068488374
    "Spain" "Albania" "2017" .03860465
    "Korea" "Albania" "2017" .1856279
    "Italy" "Albania" "2017" .063418604
    "Latvia" "Albania" "2017" .02055814
    "Portugal" "Albania" "2017" .01044186
    "Lithuania" "Albania" "2017" .023930233
    "Luxembourg" "Albania" "2017" .007395349
    "Korea" "Albania" "2018" .1856279
    "Sweden" "Albania" "2018" .08006977
    "Slovak Republic" "Albania" "2018" .033813953
    "Australia" "Albania" "2018" .1648372
    "Lithuania" "Albania" "2018" .023930233
    "Finland" "Albania" "2018" .027534883
    "Iceland" "Albania" "2018" .17386046
    "Estonia" "Albania" "2018" .02234884
    "Denmark" "Albania" "2018" .05953488
    "Türkiye" "Albania" "2018" .0824186
    "Chile" "Albania" "2018" .07467442
    "Japan" "Albania" "2018" .07409302
    "Spain" "Albania" "2018" .03860465
    "Poland" "Albania" "2018" .068488374
    "Latvia" "Albania" "2018" .02055814
    "Belgium" "Albania" "2018" .06044186
    "Norway" "Albania" "2018" .1124186
    "Germany" "Albania" "2018" .02988372
    "United Kingdom" "Albania" "2018" .042
    "New Zealand" "Albania" "2018" .23434883
    "Switzerland" "Albania" "2018" .1125814
    "France" "Albania" "2018" .04776744
    "Czech Republic" "Albania" "2018" .013023255
    "Luxembourg" "Albania" "2018" .007395349
    "Colombia" "Albania" "2018" .03672093
    "Netherlands" "Albania" "2018" .01560465
    "United States" "Albania" "2018" .11986046
    "Ireland" "Albania" "2018" .036906976
    "Slovenia" "Albania" "2018" .014860465
    "Italy" "Albania" "2018" .063418604
    "Austria" "Albania" "2018" .1540465
    "Greece" "Albania" "2018" .04106977
    "Hungary" "Albania" "2018" .028465116
    "Portugal" "Albania" "2018" .01044186
    "Iceland" "Albania" "2019" .17386046
    "United Kingdom" "Albania" "2019" .042
    "Greece" "Albania" "2019" .04106977
    "Finland" "Albania" "2019" .027534883
    "Türkiye" "Albania" "2019" .0824186
    "Portugal" "Albania" "2019" .01044186
    "Latvia" "Albania" "2019" .02055814
    "Slovak Republic" "Albania" "2019" .033813953
    "Estonia" "Albania" "2019" .02234884
    "Netherlands" "Albania" "2019" .01560465
    "Korea" "Albania" "2019" .1856279
    "Chile" "Albania" "2019" .07467442
    "Poland" "Albania" "2019" .068488374
    "United States" "Albania" "2019" .11986046
    "Italy" "Albania" "2019" .063418604
    "Japan" "Albania" "2019" .07409302
    "Austria" "Albania" "2019" .1540465
    "Slovenia" "Albania" "2019" .014860465
    "Czech Republic" "Albania" "2019" .013023255
    "Israel" "Albania" "2019" .1713023
    "Lithuania" "Albania" "2019" .023930233
    "France" "Albania" "2019" .04776744
    "Switzerland" "Albania" "2019" .1125814
    "Australia" "Albania" "2019" .1648372
    "Colombia" "Albania" "2019" .03672093
    "Luxembourg" "Albania" "2019" .007395349
    "Denmark" "Albania" "2019" .05953488
    "Hungary" "Albania" "2019" .028465116
    "Ireland" "Albania" "2019" .036906976
    "Germany" "Albania" "2019" .02988372
    "Norway" "Albania" "2019" .1124186
    "Sweden" "Albania" "2019" .08006977
    end


    Thank you in advance!

  • #2
    Maximilian:
    have you already ruled out trailing and/or leading blanks?
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Could you show us small extracts from both the "master" dataset and the "using" dataset which you are trying to merge?

      Comment


      • #4
        My guess is that there is no variable named "partnercountry" (spelled exactly like that, and with no upper-case letters in the name) in your partner_equityrestrictions.dta dataset.

        Comment


        • #5
          Such an obvious mistake but that was it Mr. Lisowski. Just couldn´t wrap my head around it.

          Thank you all for your help.

          Comment

          Working...
          X